package cn.wolfcode.trip.api.controller;

import cn.wolfcode.trip.base.query.MessageInfoQueryObject;
import cn.wolfcode.trip.base.query.MessageQueryObject;
import cn.wolfcode.trip.base.service.IMessageInfoService;
import cn.wolfcode.trip.base.service.IMessageService;
import com.github.pagehelper.PageInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/systemNotice")
public class SystemNoticeController {

    @Autowired
    private IMessageService messageService;

    @Autowired
    private IMessageInfoService messageInfoService;

    @GetMapping
    public PageInfo query(@ModelAttribute("qo") MessageQueryObject qo) {
        qo.setOrderBy("createtime DESC");
        return messageService.query(qo);
    }
}
